﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ket_noi_toi_VPP_bang_mo_hinh_ba_lop.VO;
using System.Data;

namespace Ket_noi_toi_VPP_bang_mo_hinh_ba_lop.VO
{
    class UserVOSanPham
    {
        private int _MaSP;
        private string _MaNhom;
        private string _MaNCC;
        private string _TenSP;
        private int _SoLuongHienCo;
        private int _DonGia;

        public UserVOSanPham(int MaSP, string MaNhom, string MaNCC, string TenSP, int SoLuongHienCo, int DonGia)
        {
            this._MaSP = MaSP;
            this._MaNhom = MaNhom;
            this._MaNCC = MaNCC;
            this._TenSP = TenSP;
            this._SoLuongHienCo = SoLuongHienCo;
            this._DonGia = DonGia;        
        }

        public int MASANPHAM
        {
            get { return _MaSP; }
            set { _MaSP = value; }
        }

        public string MANHOM
        {
            get { return _MaNhom; }
            set { _MaNhom = value; }
        }

        public string MANCC
        {
            get { return _MaNCC; }
            set { _MaNCC = value; }
        }

        public string TENSANPHAM
        {
            get { return _TenSP; }
            set { _TenSP = value; }
        }

        public int DONGIA
        {
            get { return _DonGia; }
            set { _DonGia = value; }
        }

        public int SOLUONGHIENCO
        {
            get { return _SoLuongHienCo; }
            set { _SoLuongHienCo = value; }
        }

        public void CreateFormCTHD(DataRow dr)
        {
            if (dr != null)
            {
                this._MaSP = dr.IsNull(0) ? 0 : Convert.ToInt32(dr[0]);
                this._MaNhom = dr.IsNull(1) ? string.Empty : Convert.ToString(dr[1]);
                this._MaNCC = dr.IsNull(2) ? string.Empty : Convert.ToString(dr[2]);
                this._TenSP = dr.IsNull(3) ? string.Empty : Convert.ToString(dr[3]);
                this._SoLuongHienCo = dr.IsNull(4) ? 0 : Convert.ToInt32(dr[4]);
                this._DonGia = dr.IsNull(5) ? 0 : Convert.ToInt32(dr[5]);
                
                
            }
        }
    }
}
